import _axios from "axios"


export let get = (url,data)=>{
   
    return new Promise((resolve,reject)=>{
        _axios.get(url,{params:data})
        .then(response=>{
            resolve(response.data)
        }).catch(err=>{
            reject({code:-1,message:"请求失败"})
        })

    })
    
}
export let post = (url,data)=>{
    
    return new Promise((resolve,reject)=>{
        _axios.post(url,data)
        .then(response=>{
            resolve(response.data)
        }).catch(err=>{
            reject({code:-1,message:"请求失败"})
        })

    })
}
